"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Global_1 = require("../models/Global");
// This is a demo code file
// Feel free to delete it
async function default_1(call) {
    // Error
    if (call.req.content === '') {
        call.error('Content is empty');
        return;
    }
    let time = new Date();
    const ret = await Global_1.Global.db.collection('houtai').insertOne({ content: call.req.content,
        time: time });
    return call.succ({ insertedId: ret.insertedId.toString() });
    // Success
    call.succ({
        insertedId: ret.insertedId.toString()
    });
}
exports.default = default_1;
